<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ page import="Dao.usersDAO" %>
<%@ page import="Dao.booksDAO" %>
<%@ page import="Dao.userBooksDao" %>
<%@ page import="JavaBean.UserBooks" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ page isELIgnored="false"%>

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>删除书本</title>
</head>
<body>
<%
    request.setCharacterEncoding("utf-8");
    String id = request.getParameter("id");
    userBooksDao dao = new userBooksDao();
    int i = dao.deleteUserBook(id);
    pageContext.setAttribute("i",i);
//    System.out.println("i = " + i);
%>
<c:if test="${i==0}">
     <script language='javascript'>alert('移除失败');window.location.href='userBooksManager.jsp';</script>
</c:if>
<c:if test="${i==1}">
     <script language='javascript'>alert('移除成功');window.location.href='userBooksManager.jsp';</script>
</c:if>
<br>
</body>
</html>